import sys
from datetime import datetime, timedelta
import unittest

sys.path.append("../")
# from tea_datetime import tea_datetime


class DatetimeTest(unittest.TestCase):
    def test_first(self):
        date_obj = datetime(2024, 3, 25, 10, 30, 15)
        print("Datetime object:", date_obj)

        now = datetime.now()
        print("Current datetime:", now)

        future_date = now + timedelta(days=7)
        print("Date after 7 days:", future_date)

        formatted_date = now.strftime('%Y-%m-%d %H:%M:%S')
        print("Formatted date:", formatted_date)

        date_string = "01-10-2020 14:45:37"
        format_string = "%m-%d-%Y %H:%M:%S"
        str_datetime = datetime.strptime(date_string, format_string)
        print("str_datetime:", type(str_datetime), type(str_datetime.strftime('%Y-%m-%d %H:%M:%S')),
              str_datetime.strftime('%Y-%m-%d %H:%M:%S'))

        date_string = "01-10-2020 14:45:37"
        format_string = "%m-%d-%Y %H:%M:%S"
        str_datetime = datetime.strptime(date_string, format_string)
        print("str_date:", type(str_datetime.strftime('%Y-%m-%d %H:%M:%S')),
              str_datetime.strftime('%Y-%m-%d'))
